<div class="bg-light lter b-b wrapper-md">
    <h4 class="m-n font-thin">交易分析</h4>
</div>
<div class="wrapper" ng-controller="transactionAnalysisCtrl">
    <div class="padder panel padder-v">
        <div class="m-b-sm">
            <div class="clearfix">
                <div class="col-sm-8 no-padder">
                    <div class="panel-body no-padder">
                        <div class="col-md-1 no-padder m-b-xs m-r">
                            <select class="form-control"  ng-model="analysis.analysisType" ng-change="query()">
                                <option value="0">自然天</option>
                                <option value="1">自然月</option>
                                <option value="2">自定义</option>
                            </select>
                        </div>
                        <div ng-if="analysis.analysisType!=2">
                            <div class="inline pull-left m-r-sm" ng-controller="DatepickerDemoCtrl">
                                <div class="input-group w-lg">
                                    <input type="text" class="form-control" placeholder="请输入开始日期" uib-datepicker-popup="yyyy-MM-dd" datepicker-popup="yyyy-MM-dd" ng-model="analysis.date" ng-change="query()" min-date="min" max-date="max"
                                           alt-input-formats="altInputFormats" is-open="opened" datepicker-options="dateOptions" close-text="关闭" clear-text="清空" current-text="今天" initialDate disabled/>
                                <span class="input-group-btn ">
                                    <button type="button" class="btn btn-default " ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                                </span>
                                </div>
                            </div>
                        </div>
                        <div ng-if="analysis.analysisType==2">
                            <div class="inline pull-left m-r-sm" ng-controller="DatepickerDemoCtrl">
                                <div class="input-group w-lg">
                                    <input type="text" class="form-control" placeholder="请输入开始日期" uib-datepicker-popup="yyyy-MM-dd" datepicker-popup="yyyy-MM-dd" ng-model="analysis.startTime" ng-change="query()" min-date="min"  max-date="max"
                                           alt-input-formats="altInputFormats" is-open="opened" datepicker-options="dateOptions" close-text="关闭" clear-text="清空" current-text="今天" initialDate disabled/>
                                <span class="input-group-btn ">
                                    <button type="button" class="btn btn-default " ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                                </span>
                                </div>
                            </div>
                            <div class="inline pull-left m-r-sm" ng-controller="DatepickerDemoCtrl">
                                <div class="input-group w-lg ">
                                    <input type="text" class="form-control" placeholder="请输入结束日期" uib-datepicker-popup="yyyy-MM-dd" datepicker-popup="yyyy-MM-dd" ng-model="analysis.endTime" ng-change="query()" max-date="max" min-date="analysis.startTime"
                                           alt-input-formats="altInputFormats" is-open="opened" datepicker-options="dateOptions" close-text="关闭" clear-text="清空" current-text="今天" initialDate disabled/>
                                <span class="input-group-btn ">
                                    <button type="button" class="btn btn-default " ng-click="open($event)"><i class="glyphicon glyphicon-calendar"></i></button>
                                </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-sm-1 pull-right no-padder">
                    <div class="text-right">
                        <button class="btn btn-success m-n" ng-click="exportAllData()">导出数据</button>
                    </div>
                </div>
            </div>
            <div>
                <!--<div class="block m-b-sm b-b padder-v padder">-->
                    <!--<div class="inline m-r-xs">-->
                        <!--<span class="h6 text-muted">访客数</span>-->
                        <!--<label class="font-bold h3 block m-t-xxs m-b-xxs">0</label>-->
                        <!--<span class="h6 text-muted block m-b-xxs" ng-if="analysisType==0">较前一天</span>-->
                        <!--<span class="h6 text-muted block m-b-xxs" ng-if="analysisType==1">较前一月</span>-->
                        <!--<span class="h5 text-muted"><i class="fa fa-level-down m-r-xs"></i>0%</span>-->
                    <!--</div>-->
                <!--</div>-->
                <div class="block m-b-sm b-b padder-v padder">
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">下单人数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.ordersUserCount='--'">{{analysisData.ordersUserCount}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersUserCountRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.ordersUserCountRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersUserCountRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.ordersUserCountRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">下单件数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.ordersGoodsCount='--'">{{analysisData.ordersGoodsCount}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersGoodsCountRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.ordersGoodsCountRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersGoodsCountRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.ordersGoodsCountRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">下单笔数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.ordersCount='--'">{{analysisData.ordersCount}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersCountRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.ordersCountRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersCountRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.ordersCountRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">下单金额(元)</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.ordersMoney='--'">{{analysisData.ordersMoney}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersMoneyRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.ordersMoneyRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.ordersMoneyRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.ordersMoneyRate}}%</span>
                    </div>
                </div>
                <div class="block m-b-sm b-b padder-v padder">
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">支付人数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.payUserCount='--'">{{analysisData.payUserCount}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.payUserCountRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.payUserCountRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.payUserCountRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.payUserCountRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">支付件数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.payNumber='--'">{{analysisData.payNumber}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.payNumberRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.payNumberRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.payNumberRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger" ></i>{{-1*analysisData.payNumberRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">支付笔数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.payOrdersCount='--'">{{analysisData.payOrdersCount}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.payOrdersCountRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.payOrdersCountRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.payOrdersCountRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.payOrdersCountRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">支付金额(元)</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.payMoney='--'">{{analysisData.payMoney}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.payMoneyRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.payMoneyRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.payMoneyRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.payMoneyRate}}%</span>
                    </div>
                </div>
                <div class="block m-b-sm b-b padder-v padder">
                    <!--<div class="inline m-r-md">-->
                        <!--<span class="h6 text-muted">下单转换率</span>-->
                        <!--<label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.ordersConversion='&#45;&#45;'">{{analysisData.ordersConversion}}%</label>-->
                        <!--<span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>-->
                        <!--<span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>-->
                        <!--<span class="h5 text-muted" ng-if="analysisData.ordersConversionRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.ordersConversionRate}}%</span>-->
                        <!--<span class="h5 text-muted" ng-if="analysisData.ordersConversionRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.ordersConversionRate}}%</span>-->
                    <!--</div>-->
                    <!--<div class="inline m-r-md">-->
                        <!--<span class="h6 text-muted">支付转换率</span>-->
                        <!--<label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.payConversion='&#45;&#45;'">{{analysisData.payConversion}}%</label>-->
                        <!--<span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>-->
                        <!--<span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>-->
                        <!--<span class="h5 text-muted" ng-if="analysisData.payConversionRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.payConversionRate}}%</span>-->
                        <!--<span class="h5 text-muted" ng-if="analysisData.payConversionRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.payConversionRate}}%</span>-->
                    <!--</div>-->
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">支付成功率</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.paySuccess='--'">{{analysisData.paySuccess}}%</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.paySuccessRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.paySuccessRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.paySuccessRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.paySuccessRate}}%</span>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">客单价(元)</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.clientPrice='--'">{{analysisData.clientPrice}}</label>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==0">较前一天</span>
                        <span class="h6 text-muted block m-b-xxs" ng-if="analysis.analysisType==1">较前一月</span>
                        <span class="h5 text-muted" ng-if="analysisData.clientPriceRate>=0&&analysis.analysisType!=2"><i class="fa fa-level-up m-r-xs text-success"></i>{{analysisData.clientPriceRate}}%</span>
                        <span class="h5 text-muted" ng-if="analysisData.clientPriceRate<0&&analysis.analysisType!=2"><i class="fa fa-level-down m-r-xs text-danger"></i>{{-1*analysisData.clientPriceRate}}%</span>
                    </div>
                </div>
                <div class="block m-b-sm b-b padder-v padder" ng-if="analysis.analysisType==0">
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">7天重复购买人数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.sevenRepeatPurchase='--'">{{analysisData.sevenRepeatPurchase}}</label>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">30天重复购买人数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.thirtyRepeatPurchase='--'">{{analysisData.thirtyRepeatPurchase}}</label>
                    </div>
                    <div class="inline m-r-md">
                        <span class="h6 text-muted">90天重复购买人数</span>
                        <label class="font-bold h3 block m-t-xxs m-b-xxs" ng-init="analysisData.ninetyRepeatPurchase='--'">{{analysisData.ninetyRepeatPurchase}}</label>
                    </div>
                </div>
            </div>
        </div>
        <div>
            <div class="row">
                <div class="col-sm-12">
                    <div class="panel-body">
                        <div class="col-sm-1 pull-right no-padder">
                            <div class="text-right">
                                <button class="btn btn-success m-n" ng-click="openExportDate()">导出数据</button>
                            </div>
                        </div>
                    </div>
                    <div>
                        <line id="main" legend="legend" item="item" data="data"></line>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>